From 8b897fa76bcfe99107ee84ab9812021692be1c9c Mon Sep 17 00:00:00 2001 From: Boris Egorov Date: Thu, 17 Dec 2015 22:41:05 +0600 Subject: [PATCH] tests: 'install' defaults to current directory Complements #2205. Fixes #2142. --- tests/test_cargo_install.rs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/tests/test_cargo_install.rs b/tests/test_cargo_install.rs index 5897a880a..9a99c403a 100644 --- a/tests/test_cargo_install.rs +++ b/tests/test_cargo_install.rs @@ -122,8 +122,7 @@ could not find `foo` in `registry file://[..]` with version `0.2.0` test!(no_crate { assert_that(cargo_process("install"), execs().with_status(101).with_stderr("\ -must specify a crate to install from crates.io, or use --path or --git \ -to specify alternate source +Could not find Cargo.toml in `[..]` ")); }); @@ -528,3 +527,18 @@ test!(subcommand_works_out_of_the_box { assert_that(cargo_process("--list"), execs().with_status(0).with_stdout_contains(" foo\n")); }); + +test!(installs_from_cwd_by_default { + let p = project("foo") + .file("Cargo.toml", r#" + [package] + name = "foo" + version = "0.1.0" + authors = [] + "#) + .file("src/main.rs", "fn main() {}"); + p.build(); + + assert_that(cargo_process("install"), execs().with_status(0)); + assert_that(cargo_home(), has_installed_exe("foo")); +}); -- 2.30.2